package club.haomoon.core.mapper.system;

import club.haomoon.core.common.BaseDataMpper;
import club.haomoon.core.entity.system.SystemRoleData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * -------------------------
 * @Description: 系统角色Mapper
 * @Author: Wangjianwei
 * @Date: 2025/02/12 15:27
 * -------------------------
 */
@Mapper
public interface SystemRoleDataMapper extends BaseDataMpper<SystemRoleData> {


    @Select("SELECT * FROM cms_system_role_data role INNER JOIN cms_admin_role_data lar ON lar.role_id = role.id WHERE lar.admin_id = #{adminId} AND role.delete_time IS NULL")
    List<SystemRoleData> getByAdminId(@Param("adminId") Integer adminId);

}
